﻿<!--
    
/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A
 * copy of the license can be found at http://go.microsoft.com/fwlink/?LinkID=131993. If
 * you cannot locate the Microsoft Public License, please send an email to
 * mixon@microsoft.com. By using this source code in any fashion, you are agreeing to
 * be bound by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 *
 * ***************************************************************************/
    
-->
<UserControl x:Class="MIXOnline.Descry.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:t="clr-namespace:MIXOnline.Descry"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    Width="960" Height="952" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
    <UserControl.Resources>
        <Style x:Key="InauguralSearchBoxStyle" TargetType="TextBox">
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Background" Value="#FFFFFFFF"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="Padding" Value="2"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Grid x:Name="RootElement">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard/>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="ReadOnly">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" Fill="#FFE4E4E4" Stroke="{x:Null}" RadiusX="8" RadiusY="8"/>
                            <Border x:Name="Border" Opacity="1" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1" Visibility="Visible">

                                <Grid>
                                    <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="#72F7F7F7" Margin="0,1,0,-1"/>
                                    <Border x:Name="MouseOverBorder" BorderBrush="{x:Null}" BorderThickness="1" Visibility="Visible">
                                        <ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}"/>
                                    </Border>
                                </Grid>
                            </Border>
                            <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Border Margin="1" x:Name="FocusVisualElement" IsHitTestVisible="False" Opacity="0" BorderBrush="#FF6DBDD1" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Name="showInfo">
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="infoPopup" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimation Duration="00:00:00.15" To="1" BeginTime="00:00:00" Storyboard.TargetName="infoPopup" Storyboard.TargetProperty="(UIElement.Opacity)"/>
        </Storyboard>
        <Storyboard x:Name="hideInfo">
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00.15" Duration="00:00:00.0010000" Storyboard.TargetName="infoPopup" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                    <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimation Duration="00:00:00.15" To="0" BeginTime="00:00:00" Storyboard.TargetName="infoPopup" Storyboard.TargetProperty="(UIElement.Opacity)"/>
        </Storyboard>
        <Storyboard x:Name="hideInfoTimer" Duration="00:00:05"/>
        <Storyboard x:Name="flipInfoPaneLeft">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="stackPanel" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="stackPanel" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="-321"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimation Duration="00:00:00.20" To="-180" BeginTime="00:00:00.10" Storyboard.TargetName="PopupPane" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"/>
        </Storyboard>
        <Storyboard x:Name="flipInfoPaneRight">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="stackPanel" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="stackPanel" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="-321"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimation Duration="00:00:00.20" To="0" BeginTime="00:00:00.10" Storyboard.TargetName="PopupPane" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"/>
        </Storyboard>
        <Style x:Key="searchBoxStyle" TargetType="TextBox">
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Background" Value="#FFFFFFFF"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="Padding" Value="2"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Grid x:Name="RootElement">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                                <SplineColorKeyFrame KeyTime="0" Value="#FF99C1E2"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="ReadOnly">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Border x:Name="Border" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3,3,3,3">
                                <Grid>
                                    <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="#72F7F7F7"/>
                                    <Border x:Name="MouseOverBorder" BorderBrush="Transparent" BorderThickness="1">
                                        <ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}"/>
                                    </Border>
                                </Grid>
                            </Border>
                            <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Border Margin="1" x:Name="FocusVisualElement" IsHitTestVisible="False" Opacity="0" BorderBrush="#FF6DBDD1" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ComboBoxStyle1" TargetType="ComboBox">
            <Setter Property="Padding" Value="6,2,25,2"/>
            <Setter Property="Background" Value="#FF1F3B53"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="TabNavigation" Value="Once"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid Width="Auto">
                            <Grid.Resources>
                                <Style TargetType="ToggleButton" x:Name="comboToggleStyle">
                                    <Setter Property="Foreground" Value="#FF333333"/>
                                    <Setter Property="Background" Value="#FF1F3B53"/>
                                    <Setter Property="BorderBrush">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FFA3AEB9" Offset="0"/>
                                                <GradientStop Color="#FF8399A9" Offset="0.375"/>
                                                <GradientStop Color="#FF718597" Offset="0.375"/>
                                                <GradientStop Color="#FF617584" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="BorderThickness" Value="1"/>
                                    <Setter Property="Padding" Value="3"/>
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="ToggleButton">
                                                <Grid>
                                                    <vsm:VisualStateManager.VisualStateGroups>
                                                        <vsm:VisualStateGroup x:Name="CommonStates">
                                                            <vsm:VisualState x:Name="Normal"/>
                                                            <vsm:VisualState x:Name="MouseOver">
                                                                <Storyboard>
                                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="Opacity">
                                                                        <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                    </DoubleAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                </Storyboard>
                                                            </vsm:VisualState>
                                                            <vsm:VisualState x:Name="Pressed">
                                                                <Storyboard>
                                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay2" Storyboard.TargetProperty="Opacity">
                                                                        <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                    </DoubleAnimationUsingKeyFrames>
                                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                        <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                    </DoubleAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#E5FFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#BCFFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                </Storyboard>
                                                            </vsm:VisualState>
                                                            <vsm:VisualState x:Name="Disabled"/>
                                                        </vsm:VisualStateGroup>
                                                        <vsm:VisualStateGroup x:Name="CheckStates">
                                                            <vsm:VisualState x:Name="Checked">
                                                                <Storyboard>
                                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundOverlay3" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                        <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                    </DoubleAnimationUsingKeyFrames>
                                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                        <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                    </DoubleAnimationUsingKeyFrames>
                                                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                        <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                    </DoubleAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#E5FFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#BCFFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                    <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient2" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                                        <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
                                                                    </ColorAnimationUsingKeyFrames>
                                                                </Storyboard>
                                                            </vsm:VisualState>
                                                            <vsm:VisualState x:Name="Unchecked"/>
                                                        </vsm:VisualStateGroup>
                                                        <vsm:VisualStateGroup x:Name="FocusStates">
                                                            <vsm:VisualState x:Name="Focused">
                                                                <Storyboard>
                                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility">
                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                            <DiscreteObjectKeyFrame.Value>
                                                                                <Visibility>Visible</Visibility>
                                                                            </DiscreteObjectKeyFrame.Value>
                                                                        </DiscreteObjectKeyFrame>
                                                                    </ObjectAnimationUsingKeyFrames>
                                                                </Storyboard>
                                                            </vsm:VisualState>
                                                            <vsm:VisualState x:Name="Unfocused"/>
                                                        </vsm:VisualStateGroup>
                                                    </vsm:VisualStateManager.VisualStateGroups>
                                                    <Rectangle x:Name="Background" RadiusX="3" RadiusY="3" Fill="#FFE4E4E4" Stroke="#FFE4E4E4" StrokeThickness="{TemplateBinding BorderThickness}"/>
                                                    <Rectangle x:Name="BackgroundOverlay" Opacity="0" RadiusX="3" RadiusY="3" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="{TemplateBinding BorderThickness}" d:IsHidden="True" Visibility="Collapsed"/>
                                                    <Rectangle x:Name="BackgroundOverlay2" Opacity="0" RadiusX="3" RadiusY="3" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="{TemplateBinding BorderThickness}" d:IsHidden="True" Visibility="Collapsed"/>
                                                    <Rectangle Margin="{TemplateBinding BorderThickness}" x:Name="BackgroundGradient" RadiusX="2" RadiusY="2" Stroke="#FFFFFFFF" StrokeThickness="1" d:IsHidden="True" Visibility="Collapsed">
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                                <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                                <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                                <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                    <Rectangle x:Name="BackgroundOverlay3" Opacity="0" RadiusX="3" RadiusY="3" Fill="#FFE4E4E4" Stroke="#00000000" StrokeThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed"/>
                                                    <Rectangle Margin="{TemplateBinding BorderThickness}" x:Name="BackgroundGradient2" Opacity="0" RadiusX="2" RadiusY="2" Stroke="#FFFFFFFF" StrokeThickness="1" Visibility="Collapsed">
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                                                <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                                                <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                                                <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                    <Rectangle Margin="{TemplateBinding BorderThickness}" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" RadiusX="2" RadiusY="2" Stroke="#FF6DBDD1" StrokeThickness="1" Visibility="Collapsed"/>
                                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                    <Rectangle Margin="1" x:Name="FocusVisualElement" IsHitTestVisible="false" Visibility="Collapsed" RadiusX="3.5" RadiusY="3.5" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Grid.Resources>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="MouseOver"/>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value=".55"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused"/>
                                    <vsm:VisualState x:Name="FocusedDropDown">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Border x:Name="ContentPresenterBorder">
                                <Grid>
                                    <ToggleButton HorizontalAlignment="Stretch" Margin="0" x:Name="DropDownToggle" Style="{StaticResource comboToggleStyle}" VerticalAlignment="Stretch" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalContentAlignment="Right">
                                        <Path Height="9" HorizontalAlignment="Right" Margin="0,0,6,0" x:Name="BtnArrow" Width="14" Stretch="Uniform" Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z ">
                                            <Path.Fill>
                                                <SolidColorBrush Color="#FFA8A8A8" x:Name="BtnArrowColor"/>
                                            </Path.Fill>
                                        </Path>
                                    </ToggleButton>
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ContentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                        <TextBlock Text=" "/>
                                    </ContentPresenter>
                                </Grid>
                            </Border>
                            <Rectangle x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" RadiusX="3" RadiusY="3" Fill="White"/>
                            <Rectangle Margin="1" x:Name="FocusVisualElement" IsHitTestVisible="false" Opacity="0" RadiusX="2" RadiusY="2" Stroke="#FF6DBDD1" StrokeThickness="1" Visibility="Collapsed"/>
                            <Popup x:Name="Popup">
                                <Border Height="Auto" HorizontalAlignment="Stretch" x:Name="PopupBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                            <GradientStop Color="#FFFEFEFE" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <ScrollViewer x:Name="ScrollViewer" BorderThickness="0" Padding="1">
                                        <ItemsPresenter/>
                                    </ScrollViewer>
                                </Border>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="QueryModeHyperlink" TargetType="HyperlinkButton">
            <Setter Property="Foreground" Value="#FF73A9D8"/>
            <Setter Property="Padding" Value="2,0,2,0"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="HyperlinkButton">
                        <Grid Cursor="{TemplateBinding Cursor}" Background="{TemplateBinding Background}">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="UnderlineTextBlock" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="UnderlineTextBlock" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledOverlay" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused"/>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <TextBlock HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="UnderlineTextBlock" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Visible" Text="{TemplateBinding Content}" TextDecorations="Underline"/>
                            <TextBlock HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="DisabledOverlay" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed" Canvas.ZIndex="1" Foreground="#FFAAAAAA" Text="{TemplateBinding Content}"/>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Visibility="Collapsed"/>
                            <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1" Visibility="Collapsed"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Storyboard x:Name="ShowCreateQuery">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectView" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="QueryView" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="ShowSelectQuery">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="QueryView" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SelectView" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style x:Key="GenerateButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="#FF1F3B53"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="Padding" Value="3"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0" Value="#33FFFFFF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0" Value="#3FFFFFFF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0" Value="#8CFFFFFF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0" Value="#3FFFFFFF"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused"/>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Border x:Name="Background" Background="{x:Null}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                                <Grid Margin="1" Background="{x:Null}">
                                    <Border Margin="0,0,0,0" Background="#FF333333" BorderBrush="#FF333333" CornerRadius="3,3,3,3" BorderThickness="1,1,1,1"/>
                                    <Border x:Name="BackgroundAnimation" Opacity="0" Background="{x:Null}"/>
                                    <Rectangle x:Name="BackgroundGradient" RadiusX="3" RadiusY="3">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                <GradientStop Color="#19FFFFFF" Offset="0.326"/>
                                                <GradientStop Color="#00FFFFFF" Offset="0.625"/>
                                                <GradientStop Color="#00FFFFFF" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Grid>
                            </Border>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                            <Rectangle x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" RadiusX="3" RadiusY="3" Fill="#FFFFFFFF"/>
                            <Rectangle Margin="1" x:Name="FocusVisualElement" IsHitTestVisible="false" Opacity="0" RadiusX="2" RadiusY="2" Stroke="{x:Null}" StrokeThickness="1"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="TextBoxStyle1" TargetType="TextBox">
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Background" Value="#FFFFFFFF"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="Padding" Value="2"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Grid x:Name="RootElement">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal"/>
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard/>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="ReadOnly">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="FocusStates">
                                    <vsm:VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Unfocused">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Border x:Name="Border" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3,3,3,3">
                                <Grid>
                                    <Border x:Name="ReadOnlyVisualElement" Opacity="0" Background="#72F7F7F7"/>
                                    <Border x:Name="MouseOverBorder" BorderBrush="{x:Null}" BorderThickness="1">
                                        <ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}"/>
                                    </Border>
                                </Grid>
                            </Border>
                            <Border x:Name="DisabledVisualElement" IsHitTestVisible="False" Opacity="0" Background="#A5F7F7F7" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}"/>
                            <Border Margin="1" x:Name="FocusVisualElement" IsHitTestVisible="False" Opacity="0" BorderBrush="{x:Null}" BorderThickness="{TemplateBinding BorderThickness}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White" Width="960">
        <StackPanel>
            <TextBox Height="0" x:Name="TakeFocus" Width="960" IsHitTestVisible="False" Opacity="1" IsTabStop="True" Text="" TextWrapping="Wrap"/>
            <Grid HorizontalAlignment="Stretch" x:Name="SearchControl" VerticalAlignment="Top" Width="960" Background="White">
                <Grid.RowDefinitions>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="65"/>
                    <RowDefinition Height="20"/>

                </Grid.RowDefinitions>
                <TextBox Grid.Row="1" x:Name="SearchTextBox" TextWrapping="Wrap" Style="{StaticResource InauguralSearchBoxStyle}" BorderBrush="{x:Null}" Foreground="#FF999999" Height="150" Opacity="1" Visibility="Collapsed"/>
                <Canvas Margin="0,0,0,0" Grid.RowSpan="3" x:Name="QueryView" Visibility="Visible" Opacity="0" IsHitTestVisible="False">
                    <StackPanel Orientation="Horizontal" Height="35" Width="960" x:Name="QueryStack" Opacity="1">
                        <TextBlock Text="Explore what their inaugural speeches had to say about " TextWrapping="NoWrap" Foreground="#FF000000" Height="Auto" Width="Auto" FontFamily="Arial" FontSize="18" x:Name="introText" Margin="0,5,0,0"/>
                        <TextBox TextWrapping="NoWrap" Width="275" Height="26" VerticalAlignment="Center" Margin="0,-5,0,0" FontFamily="Arial" FontSize="14" x:Name="msgTitle" Style="{StaticResource TextBoxStyle1}" Foreground="#FF666666" Background="#FF333333" BorderBrush="{x:Null}" FontStyle="Normal" SelectionBackground="#FF7CC4F4"/>
                        <TextBlock Text=" or, " TextWrapping="NoWrap" Foreground="#FF000000" Height="Auto" Width="Auto" FontFamily="Arial" FontSize="18" Margin="0,5,0,0"/>
                        <HyperlinkButton Content="pick a topic" FontFamily="Arial" FontSize="14" x:Name="linkPickATopic" Margin="0,7,0,0" Style="{StaticResource QueryModeHyperlink}" Foreground="#FF61B9F4" Background="{x:Null}"/>
                    </StackPanel>
                    <Path Height="10" Width="20" Canvas.Left="561.5" Canvas.Top="30.043" Fill="#FF333333" Stretch="Fill" Stroke="{x:Null}" Data="M903,28.999483 C903,28.999483 919.5,4 919.5,4 C924.16669,12.317694 935,28.953081 935,28.953081 C935,28.953081 903,28.999483 903,28.999483 z"/>
                    <Rectangle Height="55" Width="960" Fill="#FF333333" Stroke="{x:Null}" Canvas.Top="39" RadiusX="6" RadiusY="6"/>
                    <TextBox Text="" TextWrapping="Wrap" Foreground="#FF666666" Opacity="1" Height="45" Width="950" Canvas.Left="5" Canvas.Top="44" FontFamily="Arial" FontSize="14" FontStyle="Normal" x:Name="msgQuery" Background="{x:Null}" BorderBrush="{x:Null}" Style="{StaticResource TextBoxStyle1}"/>
                    <Button Content="SAVE" Height="24" Canvas.Left="760" Canvas.Top="94" Foreground="#FFCCCCCC" BorderBrush="{x:Null}" Background="#FF333333" Style="{StaticResource GenerateButtonStyle}" Width="100" IsEnabled="False" x:Name="btnSave" Margin="0,0,0,0" FontSize="12"/>
                    <Button Content="GENERATE" Click="Button_Click" Height="25" Canvas.Left="861" Canvas.Top="94" Foreground="#FFCCCCCC" BorderBrush="{x:Null}" Background="#FF333333" Style="{StaticResource GenerateButtonStyle}" Width="100" IsEnabled="False" x:Name="btnGenerate" Margin="0,0,0,0" FontSize="12"/>
                </Canvas>
                <Canvas Margin="0,0,0,0" Grid.RowSpan="3" x:Name="SelectView" Opacity="1" d:IsHidden="True">
                    <StackPanel Orientation="Horizontal" Height="35" Width="960" HorizontalAlignment="Right">
                        <TextBlock Text="Explore what their inaugural speeches had to say about " TextWrapping="NoWrap" Foreground="#FF000000" Height="Auto" Width="Auto" FontFamily="Arial" FontSize="18" Margin="0,5,0,0"/>
                        <ComboBox x:Name="SelectQuery" Width="275" MaxWidth="275" Height="25" Background="#FFE4E4E4" BorderBrush="#FFE4E4E4" FontFamily="Arial" FontSize="16" Style="{StaticResource ComboBoxStyle1}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="0,0,0,4"/>
                        <TextBlock Text=" or, " TextWrapping="NoWrap" Foreground="#FF000000" Height="Auto" Width="Auto" FontFamily="Arial" FontSize="18" Margin="0,5,0,0" Visibility="Visible"/>
                        <HyperlinkButton Content="create your own query" FontFamily="Arial" FontSize="14" Margin="0,7,0,0" Foreground="#FF61B9F4" Visibility="Visible" Style="{StaticResource QueryModeHyperlink}" x:Name="CreateQueryLink" Background="{x:Null}"/>
                    </StackPanel>
                    <Path Height="10" Width="20" Canvas.Left="561.5" Canvas.Top="30.043" Fill="#FFE4E4E4" Stretch="Fill" Stroke="{x:Null}" Data="M903,28.999483 C903,28.999483 919.5,4 919.5,4 C924.16669,12.317694 935,28.953081 935,28.953081 C935,28.953081 903,28.999483 903,28.999483 z"/>
                    <Rectangle Height="55" Width="960" Fill="#FFE4E4E4" Stroke="{x:Null}" Canvas.Top="39" RadiusX="6" RadiusY="6"/>
                    <TextBlock Text="When you select a query from the ComboBox, the contents of the query will be shown here." TextWrapping="Wrap" Foreground="#FF000000" Opacity="1" Height="45" Width="950" Canvas.Left="4" Canvas.Top="46" FontFamily="Arial" FontSize="14" FontStyle="Normal" MaxHeight="110" x:Name="msgQueryDisplay"/>
                </Canvas>
            </Grid>
            <Grid x:Name="LegendPanel" Width="Auto" HorizontalAlignment="Left" Margin="0,0,2,10">
            	<Grid.ColumnDefinitions>
            		<ColumnDefinition/>
            		<ColumnDefinition Width="5"/>
            		<ColumnDefinition/>
            		<ColumnDefinition Width="5"/>
            		<ColumnDefinition/>
            		<ColumnDefinition Width="5"/>
            		<ColumnDefinition Width="210"/>
            		<ColumnDefinition Width="5"/>
            		<ColumnDefinition/>
            		<ColumnDefinition Width="5"/>
            		<ColumnDefinition/>
            	</Grid.ColumnDefinitions>
            	<Rectangle Grid.Column="0" Margin="0,0,0,0" Fill="#3F024DA8" Stroke="{x:Null}" Cursor="Hand" Height="25" RadiusX="4" RadiusY="4" x:Name="mouseDemocrat" Opacity="0" StrokeThickness="1"/>
            	<StackPanel Grid.Column="0" Margin="0,0,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
            		<Image Width="22" Source="img/democrat.png" x:Name="demIcon" Height="25" IsHitTestVisible="False" Margin="3,0,3,0" Stretch="None"/>
            		<TextBlock Text="Democrat (0%)" TextWrapping="NoWrap" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Arial" Height="16" x:Name="msgDemocrat" Margin="0,2,5,0" FontSize="13"/>
            	</StackPanel>

            	<Rectangle Grid.Column="2" Margin="0,0,0,0" Fill="#3FFC2C2C" Stroke="{x:Null}" Cursor="Hand" Height="25" RadiusX="4" RadiusY="3" x:Name="mouseRepublican" Opacity="0"/>
            	<StackPanel Grid.Column="2" Margin="0,0,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
            		<Image Width="23" Source="img/republican.png" x:Name="repIcon" Height="18" IsHitTestVisible="False" Margin="3,0,3,0" Stretch="None"/>
            		<TextBlock Text="Republican (0%)" TextWrapping="NoWrap" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Center" Height="16" FontFamily="Arial" x:Name="msgRepublican" Margin="0,0,5,0" FontSize="13"/>
            	</StackPanel>

            	<Rectangle Grid.Column="4" Margin="0,0,0,0" Fill="#3F1D1D1D" Stroke="{x:Null}" Cursor="Hand" Height="25" RadiusX="4" RadiusY="4" x:Name="mouseFederalist" Opacity="0"/>
            	<StackPanel Grid.Column="4" Margin="0,0,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
            		<Image Width="22" Source="img/federalist.png" x:Name="fedIcon" Height="18" IsHitTestVisible="False" Margin="3,0,3,0" Stretch="None"/>
            		<TextBlock Text="Federalist (0%)" TextWrapping="NoWrap" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Center" Height="16" FontFamily="Arial" x:Name="msgFederalist" Margin="0,0,5,0" FontSize="13"/>
            	</StackPanel>

            	<Rectangle Grid.Column="6" Margin="0,0,0,0" Fill="#3F38069B" Stroke="{x:Null}" Cursor="Hand" Height="25" RadiusX="4" RadiusY="4" x:Name="mouseDemRep" Opacity="0"/>
            	<StackPanel Grid.Column="6" Margin="0,0,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
            		<Image Width="21" Source="img/democrat_republican.png" x:Name="demRepIcon" Height="18" IsHitTestVisible="False" Margin="3,0,3,0" Stretch="None"/>
            		<TextBlock Text="Democratic-Republican (0%)" TextWrapping="NoWrap" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Center" Height="16" FontFamily="Arial" x:Name="msgDemRep" Margin="0,0,5,0" FontSize="13"/>
            	</StackPanel>

            	<Rectangle Grid.Column="8" Margin="0,0,0,0" Fill="#3FD3AF43" Stroke="{x:Null}" Cursor="Hand" Height="25" RadiusX="4" RadiusY="4" x:Name="mouseWhig" Opacity="0" />
            	<StackPanel Grid.Column="8" Margin="0,0,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
            		<Image Width="15" Source="img/whig.png" x:Name="whigIcon" Height="18" IsHitTestVisible="False" Margin="3,0,3,0" Stretch="None"/>
            		<TextBlock Text="Whig (0%)" TextWrapping="NoWrap" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Center" Height="16" FontFamily="Arial" x:Name="msgWhig" Margin="0,0,5,0" FontSize="13"/>
            	</StackPanel>

            	<Rectangle Grid.Column="10" Margin="9,0,-9,0" Fill="#3FB0E205" Stroke="{x:Null}" Cursor="Hand" Height="25" RadiusX="4" RadiusY="4" x:Name="mouseNoAff" Opacity="0"/>
            	<StackPanel Grid.Column="10" Margin="9,0,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
            		<Image Width="17" Source="img/no_affiliation.png" x:Name="noAffIcon" Height="18" IsHitTestVisible="False" Margin="3,0,3,0" Stretch="None"/>
            		<TextBlock Text="No Affiliation (0%)" TextWrapping="NoWrap" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Center" Height="16" FontFamily="Arial" x:Name="msgNoAff" Margin="0,0,5,0" FontSize="13"/>
            	</StackPanel>
            </Grid>
            <t:TreeMapControl x:Name="TreeMapControl" Visibility="Visible" MouseLeftButtonUp="TreeMapControl_MouseLeftButtonUp" Background="#FF3CFF00" Cursor="Hand"/>
        </StackPanel>
        <Canvas Height="150" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300" x:Name="infoPopup" Visibility="Collapsed" RenderTransformOrigin="0.5,0.5" Opacity="0" IsHitTestVisible="False">
            <Path Height="150" Width="300" Fill="#FFFFFFFF" Stretch="Fill" Stroke="{x:Null}" Data="M20.999996,0 L259,0 C262.31369,0 265,2.686255 265,6 L265,94 C265,97.313744 262.31369,100 259,100 L20.999996,100 C17.686283,100 14.999992,97.313698 14.999996,94 L14.999996,57.499992 L13.500002,56.749985 C9.0000105,54.499969 0,49.999901 0,49.999905 C0,49.999897 11.990545,43.10936 14.988201,41.386715 L14.999996,41.379936 L14.999996,6 C14.999992,2.6862991 17.686283,0 20.999996,0 z" x:Name="PopupPane" Opacity="0.9" IsHitTestVisible="False" Visibility="Visible" RenderTransformOrigin="0,0.5">
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform x:Name="scalePopupX" ScaleX="1"/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
            <StackPanel Height="Auto" Width="245" Canvas.Left="40" Canvas.Top="22" x:Name="stackPanel" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
                <StackPanel.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </StackPanel.RenderTransform>
                <TextBlock Text="" TextWrapping="Wrap" Height="Auto" Width="245" x:Name="msgPresident" FontSize="22"/>
                <TextBlock Text="" TextWrapping="Wrap" x:Name="msgYear" Margin="0,0,0,10" />
                <StackPanel Height="Auto" Width="Auto" Orientation="Horizontal">
                    <TextBlock TextWrapping="Wrap" x:Name="msgMatches" Text="" FontWeight="Bold" />
                    <TextBlock x:Name="msgView" TextWrapping="Wrap" Margin="3,0,0,0" />
                </StackPanel>
            </StackPanel>
        </Canvas>
    </Grid>
</UserControl>
